<?php
class indexControl extends Control{
function index(){
    C('debug',false);
   $this->display('admin/index');
   }
 function groupmang(){//小组审核
     $db = M("group");
     $res = $db->all();
     $this->assign("group", $res);
	 $this->display("admin/groupmang");
	 }
  function groupstate(){//ajax小组审核通过
      $db = M("group");
      $gid = $_GET['gid'];
      $state = $db->where("gid=".$gid)->field("gstate")->find();
      $returnnum = '';
      
      if($state['gstate']==0){
          $returnnum = 1;
          $save = $db->where("gid=".$gid)->save(array("gstate"=>1));
      }else{
          $returnnum = 0;
          $save = $db->where("gid=".$gid)->save(array("gstate"=>0));
      }
      
      if($save){
          echo $returnnum;
      }
  }
}